package com.bookshopsystem.dao;

import java.util.List;

import com.bookshopsystem.mod.Publisher;

public class PublishDaoProxy implements PublisherDao{

	private SqlConnection sqlCon=null;
	private PublishDaoImp publishDaoImp=null;
	public PublishDaoProxy(){
		sqlCon=new SqlConnection();
		publishDaoImp=new PublishDaoImp(sqlCon.getConnection());
	}
	@Override
	public List<Publisher> getPublisher(int num) throws Exception {
		List<Publisher> publishers=null;
		try {
			publishers=publishDaoImp.getPublisher(num);
		} catch (Exception e) {
			throw e;
		}finally{
			sqlCon.closeConnection();
		}
		return publishers;
	}

}
